<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
    <class name="cn.firstsoft.modules.workTask.domain.WorkTaskProject" table="work_task_project">
     <id name="id" type="integer">
            <column name="id" />
            <generator class="native" >
				         <param name="sequence">WORK_TASK_PROJECT_ID_SEQ</param>
            </generator>
     </id>

        <property name="name" type="string">
               <column name="name" length="50" />
        </property>
        <property name="code" type="string">
               <column name="code" length="50" />
        </property>
        <property name="beginDate" type="timestamp">
               <column name="begin_date" length="23" />
        </property>
        <property name="endDate" type="timestamp">
            <column name="end_date" length="23"/>
        </property>
        <property name="totalDays" type="string">
               <column name="total_days" length="20" />
        </property>
        <property name="rems" type="string">
               <column name="rems" length="250" />
        </property>
        
        <many-to-one name="createUser" class="org.springside.modules.security.domain.User" fetch="select">
        	<column name="create_user_id"></column>
        </many-to-one>
        
         <many-to-one name="responsibilityUser" class="org.springside.modules.security.domain.User" fetch="select">
            <column name="responsibility_userid"/>
        </many-to-one>
        <set name="workTask" lazy="true" inverse="false" cascade="save-update" batch-size="5">
            <key>
                 <column name="work_project_id" not-null="true"/>
            </key>
            <one-to-many class="cn.firstsoft.modules.workTask.domain.WorkTask"/>
        </set>
         <set  name="workTaskDept" lazy="true" inverse="false" cascade="save-update" batch-size="5">
            <key>
              <column name="work_task_project_id" not-null="true"/>
            </key>
            <one-to-many class="cn.firstsoft.modules.workTask.domain.WorkTaskDept"/>
        </set>
        <set name="workTaskUser" lazy="true" inverse="false" cascade="save-update" batch-size="5">
            <key>
             <column name="work_task_project_id" not-null="true"/>
            </key>
            <one-to-many class="cn.firstsoft.modules.workTask.domain.WorkTaskUser"/>
        </set>
        <!--
            To add non XDoclet property mappings, create a file named
                hibernate-properties-WorkTaskProject.xml
            containing the additional properties and place it in your merge dir.
        -->
    </class>

</hibernate-mapping>
